<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.prime.com.tr/ui">

    <body>
        <ui:composition template="./../../Template/generalTemplate.xhtml">
            <ui:define name="content">
                <h:form id="form" prependId="false">
                    <p:panel header="View Raw Material Batch Records" style="height:495px;">
                        <p:dataTable var="records"  widgetVar="carsTable" value="#{viewRawMaterialBatchRecordsManagedBean.getRawMaterialRecords()}" emptyMessage="No records found with given criteria" paginator="true" rows="10">  

                            <f:facet name="header">  
                                <p:outputPanel>  
                                    <h:outputText value="Search all fields:" />  
                                    <p:inputText id="globalFilter" onkeyup="carsTable.filter()" style="width:150px" />  
                                </p:outputPanel>  
                            </f:facet>  

                            <p:column filterBy="#{records.id}"   
                                      headerText="Batch id" footerText="contains"  
                                      filterMatchMode="contains">  
                                <h:outputText value="#{records.id}" />  
                            </p:column>  

                            <p:column filterBy="#{records.rmInventoryLevel.rawMaterial.rawMaterialName}"  
                                      headerText="Product Name" footerText="endsWith"  filterMatchMode="endsWith">  
                                <h:outputText value="#{records.rmInventoryLevel.rawMaterial.rawMaterialName}" />  
                            </p:column>  

                            <p:column  filterBy="#{records.arrivalDate}"  headerText="Arrival Date" footerText="contains"  filterMatchMode="contains">  

                                <h:outputText value="#{records.arrivalDate}" >
                                  <f:convertDateTime pattern="dd/MM/yyyy"/>
                                </h:outputText>
                            </p:column>  

                            <p:column filterBy="#{records.quantity}"  
                                      headerText="Quantity" footerText="startsWith" filterMatchMode="startsWith">  
                                <h:outputText value="#{records.quantity}" />  
                            </p:column>  

                            <p:column filterBy="#{records.warehouseLocation}"  
                                      headerText="Warehouse Location" footerText="endsWith" filterMatchMode="endsWith">  
                                <h:outputText value="#{records.warehouseLocation}" />  
                            </p:column>  


                        </p:dataTable>  
                    </p:panel>
                </h:form>
            </ui:define>
        </ui:composition>
    </body>
</html>
